#pragma once

#include<iostream>

using namespace std;

#define INF 32767
#define MAXV 50

typedef char InfoType;

struct VertexType
{
	int no;
	InfoType info;
};

struct MatGraph
{
	int edges[MAXV][MAXV];
	int n;
	int e;
	VertexType vex[MAXV];
};

struct ArcNode
{
	int adjvex;
	ArcNode* nextarc;
	int weight;
};

struct VNode
{
	InfoType info;
	int count;
	ArcNode* firstarc;
};

struct AdjGraph
{
	VNode adjlist[MAXV];
	int n;
	int e;
};

void CreateMat(MatGraph& g, int A[MAXV][MAXV], int n, int e);
void DispMat(MatGraph g);
void CreateAdj(AdjGraph*& G, int A[MAXV][MAXV], int n, int e);
void DispAdj(AdjGraph* G);
void DestroyAdj(AdjGraph*& G);